import app
import json


def assertion(self, response, status_code, success, code, message):
    self.assertEqual(status_code, response.status_code)
    self.assertEqual(success, response.json().get("success"))
    self.assertEqual(code, response.json().get("code"))
    self.assertIn(message, response.json().get("message"))


def read_json():
    test_data = []
    json_file = app.past_dir + "/data/login666.json"
    with open(json_file, encoding="utf-8") as f:
        json_data = json.load(f)
        for i in json_data:
            login_data = i.get("login_data")
            status_code = i.get("status_code")
            success = i.get("success")
            code = i.get("code")
            message = i.get("message")
            test_data.append((login_data, status_code, success, code, message))
    return test_data


if __name__ == '__main__':
    print(read_json())
